<%@page contentType="text/html; charset=UTF-8" import="com.pub.database.*,java.util.*" %>
<jsp:useBean id="DataViewForm" scope="request" class="com.pub.database.DataViewForm"/>
<!-- 以下為DataView 共用設定 -->
<jsp:setProperty name="DataViewForm" property="submitMethod" value="POST"/>
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="10"/>
<jsp:setProperty name="DataViewForm" property="nowPageNum"/>
<jsp:setProperty name="DataViewForm" property="dataViewAction"/>
<jsp:setProperty name="DataViewForm" property="filterCol"/>
<jsp:setProperty name="DataViewForm" property="filterValue"/>
<jsp:setProperty name="DataViewForm" property="dvOrderByFields"/>
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq"/>
<!-- DataView 設定結束 -->
<%
        QueryBean gqbnDAO = new QueryBean(ResourceBundle.getBundle("WEB_Config").getString("DB_ALIAS"),
                                          true,
                                          ResourceBundle.getBundle("WEB_Config").getString("SOURCE_CHARSET"),
                                          ResourceBundle.getBundle("WEB_Config").getString("TARGET_CHARSET"));

        DataView dataView=null;

        dataView = new DataView(gqbnDAO);

       StringBuffer stbCondition = new StringBuffer();
       StringBuffer stbPageActionURI = new StringBuffer("testNewDataViewSingleField.jsp");

       DataViewForm.setTablesList(" dual ");

       DataViewForm.setSQLCondition(null);
       DataViewForm.setOrderByFields(null);
       DataViewForm.setOrderBySeq(null);
       DataViewForm.setGroupBy(null);
       DataViewForm.setHaving(null);

       //Hashtable lhtColRelation=new Hashtable();
       ArrayList laltColRelation=new ArrayList();
       Hashtable lhtColRelationDetail=new Hashtable();

       lhtColRelationDetail.put(dataView.STR_FIELD_NAME,"'L' as life");
       lhtColRelationDetail.put(dataView.STR_FIELD_TITLE,"'正常'");
       lhtColRelationDetail.put(dataView.STR_FIELD_KIND,"RADIO");
       lhtColRelationDetail.put(dataView.STR_FIELD_PROPERTY,"width='3%' align='center'");
       lhtColRelationDetail.put(dataView.STR_FIELD_HTML,"<input type='radio' name='asset_status%sn%' value='L'/>");
       lhtColRelationDetail.put(dataView.STR_FIELD_VALUE,"'L'");

       laltColRelation.add(new Hashtable(lhtColRelationDetail));
       lhtColRelationDetail.clear();

       DataViewForm.setColRelationUseArrayList(laltColRelation);//將欄位相關設定殖入ActionForm
       DataViewForm.setJumpPageButtonShow(false);   //是否要秀出上下頁按鈕
       DataViewForm.setPageBtnOnTop(false);         //將button and rows info 秀在頂端
       DataViewForm.setPageBtnOnButtom(true);      //將button and rows info 秀在底端
       DataViewForm.setFilterShow(false);           //是否要秀出過濾選擇欄位
       DataViewForm.setJumpPageShow(false);         //是否要秀出跳頁下拉式選單
       DataViewForm.setRowsInfoShow(false);         //是否要秀出筆數資訊
       DataViewForm.setRowPageShow(false);          //是否要秀出每頁筆數控制欄
       DataViewForm.setExcelShow(false);           //是否要秀出轉Excel button
       DataViewForm.setOrderEnable(false);          //是否要提供排序點選功能
       DataViewForm.setShowHeaderWhenNoData(true);//當ResultSet無資料是否要秀Header
       DataViewForm.setAddNewShow(true);          //是否秀出新增鈕


       DataViewForm.setTableHeaderHtml("class='td_head_grid' align='center'  width='680px'");
             //設定上一頁與下一頁按鈕的form action(通常為母頁即本頁)
       DataViewForm.setPageActionURI(stbPageActionURI.toString());
       String strResult="";
       try{
         strResult=dataView.getOutputDataView(DataViewForm);
       }
       catch(Exception e){
         e.printStackTrace();
       }
       finally{
         try{
           gqbnDAO.close();
           gqbnDAO=null;
         }
         catch(Exception e){
           e.printStackTrace();
         }
       }
%>
<html>
<head>
<title>
TestNewDataViewSingleField
</title>
</head>
<body bgcolor="#ffffff">
<%=strResult%>
</body>
</html>
